﻿# -*- coding: utf-8 -*-
import random
ci_shu = 0
while True:
    dian_nao = random.randint(1, 100)
    ci_shu += 1
    lun_shu = 0
    while True:
        wan_jia = int(input('猜一个1到100的数字。\n'))
        lun_shu += 1
        if wan_jia < dian_nao:
            print('你猜的小了。')
        elif wan_jia > dian_nao:
            print('你猜的大了。')
        else:
            print('猜对了')
            print(f'你猜了{lun_shu}轮，平均{"%.2f" % (lun_shu/ci_shu)}轮猜中。')
            break